3.383 \(\int \frac{(d+e x^r)^2 (a+b \log (c x^n))}{x^3} \, dx\)

Optimal. Leaf size=135 \[ -\frac{d^2 \left (a+b \log \left (c x^n\right )\right )}{2 x^2}-\frac{2 d e x^{r-2} \left (a+b \log \left (c x^n\right )\right )}{2-r}-\frac{e^2 x^{-2 (1-r)} \left (a+b \log \left (c x^n\right )\right )}{2 (1-r)}-\frac{b d^2 n}{4 x^2}-\frac{2 b d e n x^{r-2}}{(2-r)^2}-\frac{b e^2 n x^{-2 (1-r)}}{4 (1-r)^2} \]

[Out]

-(b*d^2*n)/(4*x^2) - (b*e^2*n)/(4*(1 - r)^2*x^(2*(1 - r))) - (2*b*d*e*n*x^(-2 + r))/(2 - r)^2 - (d^2*(a + b*Lo
g[c*x^n]))/(2*x^2) - (e^2*(a + b*Log[c*x^n]))/(2*(1 - r)*x^(2*(1 - r))) - (2*d*e*x^(-2 + r)*(a + b*Log[c*x^n])
)/(2 - r)

________________________________________________________________________________________

Rubi [A]  time = 0.162812, antiderivative size = 114, normalized size of antiderivative = 0.84, number of steps used = 4, number of rules used = 4, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.174, Rules used = {270, 2334, 12, 14} \[ -\frac{1}{2} \left (\frac{d^2}{x^2}+\frac{4 d e x^{r-2}}{2-r}+\frac{e^2 x^{-2 (1-r)}}{1-r}\right ) \left (a+b \log \left (c x^n\right )\right )-\frac{b d^2 n}{4 x^2}-\frac{2 b d e n x^{r-2}}{(2-r)^2}-\frac{b e^2 n x^{-2 (1-r)}}{4 (1-r)^2} \]

Antiderivative was successfully verified.

[In]

Int[((d + e*x^r)^2*(a + b*Log[c*x^n]))/x^3,x]

[Out]

-(b*d^2*n)/(4*x^2) - (b*e^2*n)/(4*(1 - r)^2*x^(2*(1 - r))) - (2*b*d*e*n*x^(-2 + r))/(2 - r)^2 - ((d^2/x^2 + e^
2/((1 - r)*x^(2*(1 - r))) + (4*d*e*x^(-2 + r))/(2 - r))*(a + b*Log[c*x^n]))/2

Rule 270

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*(a + b*x^n)^p,
 x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0]

Rule 2334

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(x_)^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = I
ntHide[x^m*(d + e*x^r)^q, x]}, Simp[u*(a + b*Log[c*x^n]), x] - Dist[b*n, Int[SimplifyIntegrand[u/x, x], x], x]
] /; FreeQ[{a, b, c, d, e, n, r}, x] && IGtQ[q, 0] && IntegerQ[m] &&  !(EqQ[q, 1] && EqQ[m, -1])

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rubi steps

\begin{align*} \int \frac{\left (d+e x^r\right )^2 \left (a+b \log \left (c x^n\right )\right )}{x^3} \, dx &=-\frac{1}{2} \left (\frac{d^2}{x^2}+\frac{e^2 x^{-2 (1-r)}}{1-r}+\frac{4 d e x^{-2+r}}{2-r}\right ) \left (a+b \log \left (c x^n\right )\right )-(b n) \int \frac{-d^2 \left (2-3 r+r^2\right )+4 d e (-1+r) x^r+e^2 (-2+r) x^{2 r}}{2 (1-r) (2-r) x^3} \, dx\\ &=-\frac{1}{2} \left (\frac{d^2}{x^2}+\frac{e^2 x^{-2 (1-r)}}{1-r}+\frac{4 d e x^{-2+r}}{2-r}\right ) \left (a+b \log \left (c x^n\right )\right )-\frac{(b n) \int \frac{-d^2 \left (2-3 r+r^2\right )+4 d e (-1+r) x^r+e^2 (-2+r) x^{2 r}}{x^3} \, dx}{2 \left (2-3 r+r^2\right )}\\ &=-\frac{1}{2} \left (\frac{d^2}{x^2}+\frac{e^2 x^{-2 (1-r)}}{1-r}+\frac{4 d e x^{-2+r}}{2-r}\right ) \left (a+b \log \left (c x^n\right )\right )-\frac{(b n) \int \left (-\frac{d^2 (-2+r) (-1+r)}{x^3}+4 d e (-1+r) x^{-3+r}+e^2 (-2+r) x^{-3+2 r}\right ) \, dx}{2 \left (2-3 r+r^2\right )}\\ &=-\frac{b d^2 n}{4 x^2}-\frac{b e^2 n x^{-2 (1-r)}}{4 (1-r)^2}-\frac{2 b d e n x^{-2+r}}{(2-r)^2}-\frac{1}{2} \left (\frac{d^2}{x^2}+\frac{e^2 x^{-2 (1-r)}}{1-r}+\frac{4 d e x^{-2+r}}{2-r}\right ) \left (a+b \log \left (c x^n\right )\right )\\ \end{align*}

Mathematica [A]  time = 0.304391, size = 120, normalized size = 0.89 \[ \frac{a \left (-2 d^2+\frac{8 d e x^r}{r-2}+\frac{2 e^2 x^{2 r}}{r-1}\right )+2 b \log \left (c x^n\right ) \left (-d^2+\frac{4 d e x^r}{r-2}+\frac{e^2 x^{2 r}}{r-1}\right )+b n \left (-d^2-\frac{8 d e x^r}{(r-2)^2}-\frac{e^2 x^{2 r}}{(r-1)^2}\right )}{4 x^2} \]

Antiderivative was successfully verified.

[In]

Integrate[((d + e*x^r)^2*(a + b*Log[c*x^n]))/x^3,x]

[Out]

(b*n*(-d^2 - (8*d*e*x^r)/(-2 + r)^2 - (e^2*x^(2*r))/(-1 + r)^2) + a*(-2*d^2 + (8*d*e*x^r)/(-2 + r) + (2*e^2*x^
(2*r))/(-1 + r)) + 2*b*(-d^2 + (4*d*e*x^r)/(-2 + r) + (e^2*x^(2*r))/(-1 + r))*Log[c*x^n])/(4*x^2)

________________________________________________________________________________________

Maple [C]  time = 0.24, size = 1923, normalized size = 14.2 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d+e*x^r)^2*(a+b*ln(c*x^n))/x^3,x)

[Out]

-1/2*b*(-e^2*(x^r)^2*r+d^2*r^2-4*d*e*x^r*r+2*e^2*(x^r)^2-3*d^2*r+4*d*e*x^r+2*d^2)/x^2/(-1+r)/(-2+r)*ln(x^n)-1/
4*(b*d^2*n*r^4-6*b*d^2*n*r^3+8*ln(c)*b*d^2+20*I*Pi*b*d*e*r*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)*x^r+13*b*d^2*n*
r^2-12*b*d^2*n*r-2*a*e^2*r^3*(x^r)^2+10*a*e^2*r^2*(x^r)^2+8*a*d^2+4*I*Pi*b*d*e*r^3*csgn(I*x^n)*csgn(I*c*x^n)*c
sgn(I*c)*x^r+16*a*d*e*x^r+4*I*Pi*b*d*e*r^3*csgn(I*c*x^n)^3*x^r+6*I*Pi*b*d^2*r^3*csgn(I*x^n)*csgn(I*c*x^n)*csgn
(I*c)+12*I*Pi*b*d^2*r*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)-4*I*Pi*b*d^2*csgn(I*c*x^n)^3-I*Pi*b*e^2*r^3*csgn(I*x
^n)*csgn(I*c*x^n)^2*(x^r)^2-I*Pi*b*e^2*r^3*csgn(I*c*x^n)^2*csgn(I*c)*(x^r)^2-8*I*Pi*b*e^2*r*csgn(I*c*x^n)^2*cs
gn(I*c)*(x^r)^2-8*I*Pi*b*e^2*r*csgn(I*x^n)*csgn(I*c*x^n)^2*(x^r)^2-16*a*e^2*r*(x^r)^2+26*a*d^2*r^2-24*a*d^2*r+
2*a*d^2*r^4-12*a*d^2*r^3+4*b*d^2*n+8*b*d*e*n*x^r-2*ln(c)*b*e^2*r^3*(x^r)^2+16*ln(c)*b*d*e*x^r+10*ln(c)*b*e^2*r
^2*(x^r)^2-16*ln(c)*b*e^2*r*(x^r)^2+8*ln(c)*b*e^2*(x^r)^2+4*b*e^2*n*(x^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n(I*c*x^n)*csgn(I*c)*(x^r)^2+6*I*Pi*b*d^2*
r^3*csgn(I*c*x^n)^3+12*I*Pi*b*d^2*r*csgn(I*c*x^n)^3)/(-1+r)^2/x^2/(-2+r)^2

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^r)^2*(a+b*log(c*x^n))/x^3,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 1.43618, size = 1049, normalized size = 7.77 \begin{align*} -\frac{{\left (b d^{2} n + 2 \, a d^{2}\right )} r^{4} + 4 \, b d^{2} n - 6 \,{\left (b d^{2} n + 2 \, a d^{2}\right )} r^{3} + 8 \, a d^{2} + 13 \,{\left (b d^{2} n + 2 \, a d^{2}\right )} r^{2} - 12 \,{\left (b d^{2} n + 2 \, a d^{2}\right )} r -{\left (2 \, a e^{2} r^{3} - 4 \, b e^{2} n - 8 \, a e^{2} -{\left (b e^{2} n + 10 \, a e^{2}\right )} r^{2} + 4 \,{\left (b e^{2} n + 4 \, a e^{2}\right )} r + 2 \,{\left (b e^{2} r^{3} - 5 \, b e^{2} r^{2} + 8 \, b e^{2} r - 4 \, b e^{2}\right )} \log \left (c\right ) + 2 \,{\left (b e^{2} n r^{3} - 5 \, b e^{2} n r^{2} + 8 \, b e^{2} n r - 4 \, b e^{2} n\right )} \log \left (x\right )\right )} x^{2 \, r} - 8 \,{\left (a d e r^{3} - b d e n - 2 \, a d e -{\left (b d e n + 4 \, a d e\right )} r^{2} +{\left (2 \, b d e n + 5 \, a d e\right )} r +{\left (b d e r^{3} - 4 \, b d e r^{2} + 5 \, b d e r - 2 \, b d e\right )} \log \left (c\right ) +{\left (b d e n r^{3} - 4 \, b d e n r^{2} + 5 \, b d e n r - 2 \, b d e n\right )} \log \left (x\right )\right )} x^{r} + 2 \,{\left (b d^{2} r^{4} - 6 \, b d^{2} r^{3} + 13 \, b d^{2} r^{2} - 12 \, b d^{2} r + 4 \, b d^{2}\right )} \log \left (c\right ) + 2 \,{\left (b d^{2} n r^{4} - 6 \, b d^{2} n r^{3} + 13 \, b d^{2} n r^{2} - 12 \, b d^{2} n r + 4 \, b d^{2} n\right )} \log \left (x\right )}{4 \,{\left (r^{4} - 6 \, r^{3} + 13 \, r^{2} - 12 \, r + 4\right )} x^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^r)^2*(a+b*log(c*x^n))/x^3,x, algorithm="fricas")

[Out]

-1/4*((b*d^2*n + 2*a*d^2)*r^4 + 4*b*d^2*n - 6*(b*d^2*n + 2*a*d^2)*r^3 + 8*a*d^2 + 13*(b*d^2*n + 2*a*d^2)*r^2 -
 12*(b*d^2*n + 2*a*d^2)*r - (2*a*e^2*r^3 - 4*b*e^2*n - 8*a*e^2 - (b*e^2*n + 10*a*e^2)*r^2 + 4*(b*e^2*n + 4*a*e
^2)*r + 2*(b*e^2*r^3 - 5*b*e^2*r^2 + 8*b*e^2*r - 4*b*e^2)*log(c) + 2*(b*e^2*n*r^3 - 5*b*e^2*n*r^2 + 8*b*e^2*n*
r - 4*b*e^2*n)*log(x))*x^(2*r) - 8*(a*d*e*r^3 - b*d*e*n - 2*a*d*e - (b*d*e*n + 4*a*d*e)*r^2 + (2*b*d*e*n + 5*a
*d*e)*r + (b*d*e*r^3 - 4*b*d*e*r^2 + 5*b*d*e*r - 2*b*d*e)*log(c) + (b*d*e*n*r^3 - 4*b*d*e*n*r^2 + 5*b*d*e*n*r
- 2*b*d*e*n)*log(x))*x^r + 2*(b*d^2*r^4 - 6*b*d^2*r^3 + 13*b*d^2*r^2 - 12*b*d^2*r + 4*b*d^2)*log(c) + 2*(b*d^2
*n*r^4 - 6*b*d^2*n*r^3 + 13*b*d^2*n*r^2 - 12*b*d^2*n*r + 4*b*d^2*n)*log(x))/((r^4 - 6*r^3 + 13*r^2 - 12*r + 4)
*x^2)

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: TypeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x**r)**2*(a+b*ln(c*x**n))/x**3,x)

[Out]

Exception raised: TypeError

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (e x^{r} + d\right )}^{2}{\left (b \log \left (c x^{n}\right ) + a\right )}}{x^{3}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^r)^2*(a+b*log(c*x^n))/x^3,x, algorithm="giac")

[Out]

integrate((e*x^r + d)^2*(b*log(c*x^n) + a)/x^3, x)